package decoration;

/**
 * 摩卡
 */
public class Mocha extends CondimentDecorator{
    //用来存放被装饰者的引用
    private Drink drink;
    //构造器引入而非set
    public Mocha(Drink drink) {
        this.drink = drink;
    }
    //计算咖啡基本价钱+配料价钱
    @Override
    public double cost() {
        return drink.cost()+3;
    }
    //获得咖啡的基本描述+配料名
    @Override
    public String getDescription() {
        return drink.getDescription()+",加Mocha$3";
    }
}
